class LockModel {
  String? id;
  String? serialNo;
  String? lockCode;
  String? lockName;
  int? battery;
  double? lat;
  double? lng;
  int? state;
  String? stateName;
  int? lockState;
  String? lockStateeName;
  DateTime? portalOWAt;
  String? icon;
  String? address;

  LockModel(
      {this.id,
      this.serialNo,
      this.lockCode,
      this.lockName,
      this.battery,
      this.lat,
      this.lng,
      this.state,
      this.stateName,
      this.lockState,
      this.lockStateeName,
      this.portalOWAt,
      this.icon,
      this.address});

  LockModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    serialNo = json['serialNo'];
    lockCode = json['lockCode'];
    lockName = json['lockName'];
    battery = json['battery'];
    lat = json['lat'];
    lng = json['lng'];
    state = json['state'];
    stateName = json['stateName'];
    lockState = json['lockState'];
    lockStateeName = json['lockStateeName'];
    portalOWAt = json['portalOWAt'] != null
        ? DateTime.tryParse(json['portalOWAt'])
        : null;
    icon = json['icon'];
    address = json['address'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['serialNo'] = this.serialNo;
    data['lockCode'] = this.lockCode;
    data['lockName'] = this.lockName;
    data['battery'] = this.battery;
    data['lat'] = this.lat;
    data['lng'] = this.lng;
    data['state'] = this.state;
    data['stateName'] = this.stateName;
    data['lockState'] = this.lockState;
    data['lockStateeName'] = this.lockStateeName;
    data['portalOWAt'] = this.portalOWAt;
    data['icon'] = this.icon;
    data['address'] = this.address;
    return data;
  }
}
